<!DOCTYPE html>

<html>
    <head>
        <meta charset="UTF-8">
        <title>解析EventTarget接口</title>
        <script>
            // https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Functions#函数定义
            // 函数表达式: let fn = function(){ }
            // IIFE: Immediately Invoked Function Expression
            // 使用形式: 
            // ( functionException )( ...params )
            // 举例:
            ( function(name){ console.log(`欢迎${name}`) } )( '阿芳' );
            ( function(a,b) { console.log( a+b ) } )( 100, 200 );
            ( function(g) { console.log(g) } )( window );
            ( g => console.log( g ) )( window );

            console.log( '- '.repeat(20) );

            (()=>{
                let array;
                console.log( 'EventTarget的类属性(值属性和函数属性)' );
                array = Object.getOwnPropertyNames( EventTarget );
                array.forEach( name => console.log( '\t', name ) );
                console.log( 'EventTarget的原型属性(值属性和函数属性)' );
                array = Object.getOwnPropertyNames( EventTarget.prototype );
                array.forEach( name => console.log( '\t', name ) );
                console.log( EventTarget.prototype.constructor === EventTarget );
            })();
        </script>
    </head>
    <body>
        <h1>解析EventTarget接口</h1>
        <p>请在浏览器终端中查看运行结果</p>
    </body>
</html>